﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FuQinTube
{
    public class Tube
    {
        #region 属性
        public string SYSTEM { get; set; } = "NA";
        public string FACTORY { get; set; } = "NA";
        public string ROOM_NUMBER { get; set; } = "NA";
        public string SHEET_CODE { get; set; } = "NA";
        public string INSTRUMENT_TAG { get; set; } = "NA";
        public string P_ID_NUMBER { get; set; } = "NA";
        public string REMARKS { get; set; } = "NA";
        public string SYSTEM_CHINESE_NAME { get; set; } = "NA";
        public string DRAWING_NAME{ get; set; } = "NA";
        public string DOC_NO { get; set; } = "NA";
        public string PIPELINE_DESIGN_PRESSURE { get; set; } = "NA";
        public string PIPELINE_DESIGN_TEMPERA { get; set; } = "NA";
        public string HYDRAULIC_TEST_PRESSURE { get; set; } = "NA";
        public string PRESSURE { get; set; } = "NA";
        public string TEMPERATURE { get; set; } = "NA";
        public string NUMBER { get; set; } = "NA";
        #endregion

        #region ListViewItem
        public ListViewItem ToListItem()
        {
            
                ListViewItem item = new ListViewItem();
                item.Text = INSTRUMENT_TAG;
                item.SubItems.Add(NUMBER);
                item.SubItems.Add(SYSTEM);
                item.SubItems.Add(FACTORY);
                item.SubItems.Add(ROOM_NUMBER);
                item.SubItems.Add(SHEET_CODE);
                item.SubItems.Add(P_ID_NUMBER);
                item.SubItems.Add(REMARKS);
                item.SubItems.Add(SYSTEM_CHINESE_NAME);
                item.SubItems.Add(DRAWING_NAME
);
                item.SubItems.Add(DOC_NO);
                item.SubItems.Add(PIPELINE_DESIGN_PRESSURE);
                item.SubItems.Add(PIPELINE_DESIGN_TEMPERA);
                item.SubItems.Add(HYDRAULIC_TEST_PRESSURE);
                item.SubItems.Add(PRESSURE
);
                item.SubItems.Add(TEMPERATURE);

                return item;


         
        }
        //public string ToImportString()
        //{
        //    StringBuilder sb = new StringBuilder();
        //    string template = "{0}={1}";

        //        foreach (PropertyInfo p in this.GetType().GetProperties())
        //        {

        //            string temp = string.Format(template, p.Name, p.GetValue(this));
        //            Console.WriteLine(temp);
        //            sb.AppendLine(temp);
        //        }
        //        sb.AppendLine();
        //        return sb.ToString();
        //}



        #endregion




    }
}
